home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / lang / Python16_Src.lha / Python16_Source / Python / strerror.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-08-03  |  451 b   |  24 lines

  1. /* PD implementation of strerror() for systems that don't have it.
  2.    Author: Guido van Rossum, CWI Amsterdam, Oct. 1990, <guido@cwi.nl>. */
  3.  
  4. #include <stdio.h>
  5.  
  6. extern int sys_nerr;
  7. extern char *sys_errlist[];
  8.  
  9. char *
  10. strerror(err)
  11.     int err;
  12. {
  13.     static char buf[20];
  14.     if (err >= 0 && err < sys_nerr)
  15.         return sys_errlist[err];
  16.     sprintf(buf, "Unknown errno %d", err);
  17.     return buf;
  18. }
  19.  
  20. #ifdef macintosh
  21. int sys_nerr = 0;
  22. char *sys_errlist[1] = 0;
  23. #endif
  24.